home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / is_con10.zip / ISCONSOL.ASM next >
Assembly Source File  |  1993-05-04  |  650b  |  31 lines

  1.     PUBLIC    isconsole
  2.  
  3. IS_DEVICE    EQU    0080H
  4. IS_FASTCONSOLE    EQU    0010H
  5. IS_CONSOUT    EQU    0002H
  6. IS_CONSIN    EQU    0001H
  7.  
  8. ;int isconsole(int handle)
  9. isconsole    PROC    NEAR
  10.  
  11.     mov    ax,4400H        ;IOCTL svc, get device information
  12.     mov    bx,sp            ;parm is stack-relative
  13.     mov    bx,SS:[bx+2]        ;get handle
  14.     int    21H            ;result in DX
  15.  
  16.     mov    ax,dx            ;into AX for faster testing
  17.     xor    dx,dx            ;handy 0
  18.     test    ax,IS_DEVICE
  19.     jz    Ret_False        ;not a device at all
  20.     test    ax,IS_FASTCONSOLE
  21.     jz    Ret_False
  22.     test    ax,IS_CONSOUT
  23.     jz    Ret_False
  24.     test    ax,IS_CONSIN
  25.     jz    Ret_False
  26.      not    dx            ;return non-0, TRUE
  27. Ret_False:
  28.     mov    ax,dx            ;return function in AX
  29.     ret
  30. isconsole    ENDP
  31.